<template>
  <section class="content content_honor content_gap">
    <div class="detail">
      <div class="detail_title">
        你的荣誉
      </div>
      <div class="honor-list">
        <div class="honor-item">
          <img src="../../assets/images/bean.png" height="35" />
          <div class="honor-content-wrapper">
            <div class="honor-title">捐赠专注豆</div>
            <div class="honor-desc">{{ donateAmount }}</div>
            <div class="view-honor" @click='viewRecord'>
              <span>查看捐赠记录</span>
              <i class="view-more"></i>
            </div>
          </div>
        </div>
        <div class="honor-item">
          <img src="../../assets/images/honor.png" height="35" />
          <div class="honor-content-wrapper">
            <div class="honor-title">获得公益奖章</div>
            <div class="honor-desc" style="color: #AF5C41;">{{ moreCount + commonCount + lessCount }}</div>
            <div class="view-honor" @click='viewHonor'>
              <span>查看所有奖章</span>
              <i class="view-more"></i>
            </div>
          </div>
        </div>
      </div>
    </div>
  </section>
</template>

<script>
export default {
  props: {
    donateAmount: Number,
    moreCount: Number,
    commonCount: Number,
    lessCount: Number,
  },
  methods: {
    viewRecord() {
      enddelay_title.postMessage('捐赠记录')
      this.$router.push({
        name: 'myRecord'
      })
    },
    viewHonor() {
      enddelay_title.postMessage('公益奖章')
      this.$router.push({
        name: 'myHonor',
        query: {
          moreCount: this.moreCount,
          commonCount: this.commonCount,
          lessCount: this.lessCount,
        },
      })
    },
  }
}
</script>

<style lang="less" scoped>
.content_honor {
  .honor-list {
    display: flex;
    margin-top: 10px;
  }
  .honor-item {
    flex: 1;
    border-radius: 24px;
    color: #727E89;
    padding: 18px 21px;
    width: 230px;
    height: 200px;
    box-sizing: border-box;
    &:first-child {
      background: #FFEDEF;
      margin-right: 15px;
    }
    &:last-child {
      background: #FFF2E6;
    }
  }
  .honor-content-wrapper {
    padding: 0 8px;
  }
  .honor-title {
    font-family: PingFangSC-Regular;
    font-size: 24px;
    color: #727E89;
    margin-top: 14px;
  }
  .honor-desc {
    color: #F56D7B;
    font-weight: 500;
    font-family: PingFangSC-Semibold;
    font-size: 32px;
    margin-top: 10px;
  }
  .view-honor {
    opacity: 0.5;
    font-family: PingFangSC-Regular;
    font-size: 18px;
    color: #727E89;
    margin-top: 12px;
  }
  .view-honor span {
    display: inline-block;
    vertical-align: middle;
  }
  .view-more {
    width: 10px;
    height: 16px;
    background: url(~@/assets/images/left_gray.png);
    background-size: cover;
    display: inline-block;
    vertical-align: middle;
  }
}
</style>